using System;
using System.Web.Mvc;
using Toast.ContentTypes;
using Toast.Core;

namespace Toast.Attributes
{
    [Obsolete("Use Content Attribute")]
    [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
    public class RemoteFileScriptAttribute : ActionFilterAttribute
    {
        public RemoteFileScriptAttribute(InjectAt injectAt, string url)
        {
            RequestContentTable.Contents.Add(RemoteJavaScriptFile.FromUrl(url, injectAt));
        }

        public RemoteFileScriptAttribute(string url)
        {
            RequestContentTable.Contents.Add(RemoteJavaScriptFile.FromUrl(url, InjectAt.Default));
        }
    }
}